// 选出设置里的弹出块
var setblock = document.getElementsByClassName('set-block')[0];
var setting = document.getElementsByClassName('setting')[0];
var keySet = true;

setting.addEventListener('mouseover',function(){
    setblock.style.display = "block";
    setting.style.color = "#315efb";
},false)
// 此处会出现常见问题：“设置”上出现的弹出块不能衔接到弹出块上
// 可以用一种过渡的效果让弹出块消失缓慢进行（transition？）
// 我这里用的是计时器函数使消失延迟进行
setting.addEventListener('mouseout',function(){
    var timer = setTimeout(function(){
        if(keySet){
            setblock.style.display = "none";
        }
        clearTimeout(timer);
    },300)
    setting.style.color = "#222";
},false)
setblock.addEventListener('mouseover',function(){
    keySet = false;
    setblock.style.display = "block";
},false)
setblock.addEventListener('mouseout',function(){
    setblock.style.display = "none";
    keySet = true;
},false)
// 设置里的弹出块



// 搜索框的JS修改
var keySearch = true;
var search = document.getElementsByClassName('search-border')[0];
search.addEventListener('focus',function(){
    // search.style.borderColor = "#4e6ef2";
    search.className = "search-border fl search-blue";
    keySearch = false;
},false)
search.addEventListener('blur',function(){
    // search.style.borderColor = "#c4c7ce";
    search.className = "search-border fl search-grey";
    keySearch = true;
},false)
search.addEventListener('mouseover',function(){
    if(keySearch){
        search.className = "search-border fl search-dark";
    }
},false)
search.addEventListener('mouseout',function(){
    if(keySearch){
        search.className = "search-border fl search-grey";
    }
},false)
// 搜索框的JS修改



// 二维码的弹出块显示
var codeBlock = document.getElementsByClassName('extra-block')[0];
var twocode = document.getElementById('twodim-code');
twocode.addEventListener('mouseover',function(){
    codeBlock.style.display = "block";
    twocode.children[0].style.color = "#4662d9";
    twocode.className = "iconfont shadow";
},false)
twocode.addEventListener('mouseout',function(){
    codeBlock.style.display = "none";
    twocode.children[0].style.color = "#575454";
    twocode.className = "iconfont";
},false)
codeBlock.addEventListener('mouseover',function(){
    codeBlock.style.display = "block";
},false)
codeBlock.addEventListener('mouseout',function(){
    codeBlock.style.display = "none";
},false)
// 二维码的弹出块显示
